Repository navigation
Tuple inference for (...args: A) => T with mixed parameter types; -mm=own throw() at a yield* reaches the delegate (TSLANG 184) - #1021
Merged
Conversation
ASDAlexander77
force-pushed
the
tslang-184
branch
from
November 24, 2026 14:58
12bbd73 to
e21f910
Compare
…=own throw() at a yield* reaches the delegate (TSLANG 184) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a yield* is handed to the delegate there now) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
force-pushed
the
tslang-184
branch
from
November 24, 2026 15:44
e21f910 to
86226cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSLANG 184, stacked on #1020 (183). Will be retargeted to main once #1020 merges.
(...args: A) => T(call2((a: number, b: string) => b + a, 1, "x")):Ais inferred as the tuple[number, string](tryInferFunction), the rest arguments are taken as that tuple instead of re-inferred as an array of their union, and an unnamed tuple extends an array whose element each element extends (extendsType). The adapters read parameters out of a rest tuple as out of a rest array. Works in every model for a function or arrow given directly.yield* inner()is handed to the delegate's throw() for elements that own nothing (number, boolean), like own's return(). The delegate is exchanged into a local for the call and the thrown value out of the generator's field first. Memory flat at 300k vs 3M iterations.Still open (TSLANG_ISSUES.md 184): own throw() at a yield* of strings/objects (throws at the yield as before); a delegate with
throwbut noreturn.Tests: tuple cases added to
00generic_arrow_through_generic.ts(gc, rc); own legs added for00generator_yield_star_throw.ts. Full local suite: only the 10 known local failures.🤖 Generated with Claude Code